package com.zzk.minemodule.ui.userdetail;

import android.os.Bundle;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.zzk.baselibrary.base.RXBaseActivity;
import com.zzk.baselibrary.router.RoutePath;
import com.zzk.minemodule.BR;
import com.zzk.minemodule.R;
import com.zzk.minemodule.databinding.ActivityUserDetailBinding;

/**
 * @ProjectName: RXMVVMBaseComponent
 * @Package:
 * @ClassName:
 * @Description:
 * @Author: brilliantzhao
 * @CreateDate: 2021.1.14 9:39
 * @UpdateUser:
 * @UpdateDate: 2021.1.14 9:39
 * @UpdateRemark:
 * @Version: 1.0.0
 */
@Route(path = RoutePath.MineModule.PAGE_UserDetailActivity)
public class UserDetailActivity extends RXBaseActivity<UserDetailViewModel, ActivityUserDetailBinding> {

    //拿到路由过来的参数
    @Autowired()
    String name;

    @Override
    public void initParam() {
        //注入路由框架，拿到Autowired值，必须在initParam方法中注入，不然传到ViewModel里面的name为空
        ARouter.getInstance().inject(this);
    }

    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_user_detail;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public void initData() {
        viewModel.setName(name);
    }
}

